/*
 * author      : dormi330
 * date        : 2018/6/24
 * description : sku和数量
 */

package com.deep.trade.order.dto;

import com.deep.trade.common.BaseDto;

import java.util.ArrayList;
import java.util.List;

public class InDtoPlaceOrder extends BaseDto {

    private String addressId;                       // 会员收货地址id
    private String remark;
    private List<SkuAndQty> skuAndQtyList;          // sku-qty 列表
    private boolean audit = true;                   // 是否审核

    public InDtoPlaceOrder() {
    }

    public InDtoPlaceOrder(String addressId, String remark) {
        this.addressId = addressId;
        this.remark = remark;
        this.skuAndQtyList = new ArrayList<>();
    }

    public InDtoPlaceOrder addSkuAndQty(String skuId, int qty) {
        skuAndQtyList.add(new SkuAndQty(skuId, qty));
        return this;
    }

    //  === setter / getter ===

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getAddressId() {
        return addressId;
    }

    public List<SkuAndQty> getSkuAndQtyList() {
        return skuAndQtyList;
    }

    public void setSkuAndQtyList(List<SkuAndQty> skuAndQtyList) {
        this.skuAndQtyList = skuAndQtyList;
    }

    public void setAddressId(String addressId) {
        this.addressId = addressId;
    }

    public boolean isAudit() {
        return audit;
    }

    public void setAudit(boolean audit) {
        this.audit = audit;
    }
}